package testes;

import static org.junit.Assert.fail;

import org.junit.Assert;
import org.junit.Test;

import codigoBase.MyDynamicStack;
import codigoBase.MyGenericsStack;

public class MyGenericsStackTeste {

	private MyGenericsStack myGS;
	
	
	
	@Test
	public void testMyGenericsStack() {
		myGS = new MyGenericsStack(10);
		Assert.assertNotNull(myGS);
		
	}

	@Test
	public void testPush() {
		myGS = new MyGenericsStack(2);
		Object entry = new Object();
		myGS.push(entry);
		myGS.push(entry);
		myGS.push(entry);
		
	}

	@Test
	public void testPop()  {
		myGS = new MyGenericsStack(2);
		Object entry = new Object();
		myGS.push(entry);
		try {
			myGS.pop();
			myGS.pop();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

	@Test
	public void testPeek() {
		myGS = new MyGenericsStack(2);
		myGS.push(1);
		Assert.assertEquals(1, myGS.peek());
	}

	@Test
	public void testIsStackEmpty() {
		myGS = new MyGenericsStack(0);
		Assert.assertEquals(true, myGS.isStackEmpty());

	}

	@Test
	public void testIsStackFull() {

		myGS = new MyGenericsStack(1);
		myGS.push(1);
		Assert.assertEquals(true, myGS.isStackFull());
	}

}
